home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
public
/
sgiCD
/
README
< prev
Wrap
Text File
|
1994-08-01
|
3KB
|
69 lines
Here are a couple of programs I wrote to learn about the SGI CD audio library
routines, as well as something about how audio CD data is stored.
Cdinfo displays some basic information about an audio disk - total length,
number of tracks, length of each track, etc.
Cdreader plays an audio CD loaded in an SGI CDrom drive through the SGI
Indigo's speaker. This is NOT like SGI's "cdplayer", which simply commands the
CD drive to play an audio CD, because in that case, the audio output is sent to
the headphone jack on the front and the audio out jacks on the back of the
drive. This program uses SGI's libcdaudio routines to read the digital data
directly from the CD, and play the samples through the Audio Processor.
Cdinfo and Cdreader may also work on other SGI models with similar audio
capabilities, but I can't tell since I don't have access to any of them. It
uses an relatively insignificant amount of CPU (6-7% according to "top"), but
does raise the load average up over 1.0. Any significant amount of I/O by
other programs causes slight pauses in the music, so I suspect that "cdreader"
is using a fairly high percentage of the SCSI bandwidth. This is not something
you'd want to run every day, all day long, but it was fun to write, and will
let me listen to an audio CD in a pinch.
While working on these programs, I discovered several problems in the SGI CD
audio library routines and documentation. These have already been reported to
SGI customer service, so hopefully they'll be fixed by the next operating
system release. I wrote them using an SGI Indigo running Irix 4.0.1, with the
ANSI C compiler (unknown version number - "cc -V" complains about being
obsolete, and "file" command prints the same version number for every command
on my system - they can't ALL be version 2.10).
1. The CDreadda(3) manpage says it returns the number of frames read. In
reality, it returns the number of bytes read. You have divide by
CDDA_BLOCKSIZE to get the number of frames. I'd like to see SGI fix this
to match the manpage. The number of frames is much more useful.
2. The CDgetstatus() routine resets the CDrom "current location" to the
beginning of the disc. In other words as soon as you call it to find out
the current track/min/sec/frame, that information is no longer correct.
3. The include file "/usr/include/cdaudio.h" has an extra trailing comma in
the CDDATATYPES enumeration definition. This is harmless, but produces the
following Warning message every time you re-compile (It doesn't show up if
you use the "-cckr" option):
accom: Warning 314: /usr/include/cdaudio.h, line 324: Trailing comma in
enumeration is illegal: accepted as extension (ANSI C 3.5.2.2)
} CDDATATYPES;
^
Sure, this is easy to workaround on my workstation, but I'd like to see SGI
fix it so I don't have to do this every time an OS upgrade comes out.
4. The CDresetparser(3) manpage shows the syntax for CDdeleteparser().
5. The CDaudio(3) manpage mentions only "-lcdaudio". I found that to link my
programs required an extra library. You must use "-lcdaudio -lds".
--------
Again, THANKS SGI for making such wonderful libraries of routines available.
Libaudio, libcdaudio, and the snoop(7) routines make my Indigo an extremely fun
machine to use.
Patrick Wolfe (pwolfe@kai.com, uunet!uiucuxc!kailand!pwolfe)
System Programmer/Operations Manager, Kuck & Associates